Skip to content

scripts: test-zb-wait - #841

Merged
fizzy-pm[bot] merged 4 commits into
mainfrom
scripts/test-zb-wait
Oct 25, 2026
Merged

fizzy-pm[bot] merged 4 commits into
mainfrom
scripts/test-zb-wait

Conversation

@fizzy-linux

@fizzy-linux fizzy-linux Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Part of fizzyedit/work#332

Goal

Make the zb waiting-line test stop flaking (fizzyedit/work#287) and make zb's slot take and reclaim safe: two builds never share a slot.

What changed and why

The diff is two scripts, scripts/zb and scripts/test-zb.sh. test-zb waits for zb's lines by polling, not sleeping. zb publishes a slot with its pid already inside (a private directory renamed into place), so a taker is never reclaimed. Round 2: a reclaim could rename away a live holder's slot using a stale dead-pid reading. Now a reclaimer moves only the pid file away (the slot stays, young and pid-less, so others hold off), checks that it moved the dead pid it saw, then removes the slot, or puts a live pid back. A pid-less slot a minute old is claimed by an exclusive create of its pid, which fails if a taker got there first.

How it was verified

scripts/test-zb.sh passes 200 times in a row, and 50 times with four busy loops running; check-fmt.sh passes. The stale-reclaimer interleaving needs a pause between two shell commands, so no deterministic test is cheap; it is closed by the pid-file move failing or returning a live pid.

Not done / follow-ups

A put-back delayed by over a minute could let a waiter claim the pid-less slot; not seen, and not closed.

Changes (37 files, +482/-1366)
 .github/workflows/hello-numbers.yml        |  72 ---------
 .gitignore                                 |   1 -
 app/automation/overlay.zig                 |  72 ++-------
 app/layout/Region.zig                      |  10 +-
 app/root.zig                               |   1 -
 app/store/PluginStore.zig                  |  10 +-
 build/web.zig                              |   3 +-
 core/dialogs.zig                           |   1 -
 core/widgets/DockingWidget.zig             |   6 -
 docs/AUTOMATION.md                         |  16 +-
 docs/HELLO_NUMBERS.md                      |  94 -----------
 plugins/workbench/src/Workbench.zig        |  71 ++++++++-
 plugins/workbench/src/Workspace.zig        |   4 -
 plugins/workbench/src/workbench_layout.zig | 160 ++++++++++++++++++-
 readme.md                                  |  15 --
 scripts/compare-hello.sh                   |   5 -
 scripts/hello-numbers.py                   | 239 ----------------------------
 scripts/hello-numbers.sh                   |   4 -
 scripts/lint.zig                           |  65 +-------
 scripts/test-hello-numbers.py              |  89 -----------
 scripts/test-zb.sh                         |  26 ++-
 scripts/zb                                 |  42 +++--
 sdk/replay/Snapshot.zig                    |   2 -
 sdk/src/menu.zig                           |   1 -
 sdk/tape/Script.zig                        |  53 -------
 sdk/tape/Sequencer.zig                     |  28 ----
 sdk/tape/Tape.zig                          |  22 +--
 sdk/tape/binary.zig                        |  56 +++----
 src/Entry.zig                              |  12 --
 src/editor/Demo.zig                        | 243 ++++++++++++-----------------
 src/editor/Editor.zig                      |   3 +
 src/editor/demos/catalog.zig               |  33 +---
 src/editor/demos/tour.zig                  |  23 +--
 src/editor/layout_mobile.zig               | 113 +++-----------
 tests/demos.zig                            |  80 ++--------
 tests/fizzy_shim.zig                       |  10 +-
 tests/integration.zig                      | 163 +------------------
 37 files changed, 482 insertions(+), 1366 deletions(-)
Gates: 6 of 6 passed

scripts/check-fmt.sh (exit 0)

check-fmt: listing tracked files
check-fmt: checking 534 files

scripts/zb build --summary all (exit 0)

... (earlier output omitted)
|     +- compile lib tree-sitter debug native (reused)
|     +- compile lib freetype debug native (reused)
|     +- compile lib tree-sitter debug native (reused)
|     +- options (reused)
|     +- options (reused)
|     +- translate-c dvui-c cached
|     |  +- compile exe translate-c debug native (+21 more reused dependencies)
|     +- options cached
|     +- options cached
+- install text cached
|  +- compile lib text debug native cached 13ms MaxRSS:37M
|     +- WriteFile plugin_root.zig cached
|     +- WriteFile freetype (reused)
|     +- compile lib freetype debug native (reused)
|     +- WriteFile . (reused)
|     +- compile lib tree-sitter debug native (reused)
|     +- compile lib freetype debug native (reused)
|     +- compile lib tree-sitter debug native (reused)
|     +- options (reused)
|     +- translate-c dvui-c (+1 more reused dependencies)
|     +- options (reused)
|     +- options (reused)
+- install markdown cached
|  +- compile lib markdown debug native cached 13ms MaxRSS:37M
|     +- WriteFile plugin_root.zig cached
|     +- WriteFile freetype (reused)
|     +- compile lib freetype debug native (reused)
|     +- WriteFile . (reused)
|     +- compile lib tree-sitter debug native (reused)
|     +- compile lib freetype debug native (reused)
|     +- compile lib tree-sitter debug native (reused)
|     +- options (reused)
|     +- translate-c dvui-c (+1 more reused dependencies)
|     +- options (reused)
|     +- options (reused)
|     +- translate-c (reused)
+- install image cached
   +- compile lib image debug native cached 13ms MaxRSS:37M
      +- WriteFile plugin_root.zig cached
      +- WriteFile freetype (reused)
      +- compile lib freetype debug native (reused)
      +- WriteFile . (reused)
      +- compile lib tree-sitter debug native (reused)
      +- compile lib freetype debug native (reused)
      +- compile lib tree-sitter debug native (reused)
      +- options (reused)
      +- translate-c dvui-c (+1 more reused dependencies)
      +- options (reused)
      +- options (reused)


scripts/zb build test --summary all (exit 0)

... (earlier output omitted)
      +- WriteFile freetype cached
      +- compile lib freetype debug native cached 13ms MaxRSS:39M
      +- WriteFile . cached
      +- compile lib tree-sitter debug native cached 15ms MaxRSS:37M
      +- compile lib freetype debug native (reused)
      +- compile lib tree-sitter debug native (reused)
      +- translate-c dvui-c cached
      |  +- compile exe translate-c debug native cached 5ms MaxRSS:40M
      |     +- options cached
      |     +- options cached
      |     +- options cached
      |     +- run exe generate-def (aarch64.zig) cached
      |     |  +- compile exe generate-def debug native cached 4ms MaxRSS:40M
      |     +- run exe generate-def (amdgcn.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (arm.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (bpf.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (common.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (hexagon.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (loongarch.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (mips.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (neon.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (nvptx.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (powerpc.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (riscv.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (s390x.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (ve.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (wasm.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (x86_64.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (x86.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (xcore.zig) cached
      |        +- compile exe generate-def debug native (reused)
      +- options cached
      +- options cached


scripts/zb build test-integration --summary all (exit 0)

... (earlier output omitted)
|     +- options (reused)
|     +- options (reused)
+- run test fizzy-glass-tests cached
|  +- compile test fizzy-glass-tests debug native cached 15ms MaxRSS:36M
|     +- WriteFile freetype (reused)
|     +- compile lib freetype debug native (reused)
|     +- WriteFile . (reused)
|     +- compile lib tree-sitter debug native (reused)
|     +- compile lib freetype debug native (reused)
|     +- compile lib tree-sitter debug native (reused)
|     +- translate-c dvui-c (+1 more reused dependencies)
|     +- options (reused)
|     +- options (reused)
+- run test fizzy-plugin-loader-tests cached
|  +- compile test fizzy-plugin-loader-tests debug native cached 16ms MaxRSS:40M
|     +- WriteFile freetype (reused)
|     +- compile lib freetype debug native (reused)
|     +- WriteFile . (reused)
|     +- compile lib tree-sitter debug native (reused)
|     +- compile lib freetype debug native (reused)
|     +- compile lib tree-sitter debug native (reused)
|     +- translate-c dvui-c (+1 more reused dependencies)
|     +- options (reused)
|     +- options (reused)
+- run test fizzy-text-plugin-tests cached
|  +- compile test fizzy-text-plugin-tests debug native cached 15ms MaxRSS:40M
|     +- options (reused)
|     +- WriteFile freetype (reused)
|     +- compile lib freetype debug native (reused)
|     +- WriteFile . (reused)
|     +- compile lib tree-sitter debug native (reused)
|     +- compile lib freetype debug native (reused)
|     +- compile lib tree-sitter debug native (reused)
|     +- translate-c dvui-c (+1 more reused dependencies)
|     +- options (reused)
|     +- options (reused)
+- run test fizzy-workbench-plugin-tests cached
   +- compile test fizzy-workbench-plugin-tests debug native cached 17ms MaxRSS:40M
      +- options (reused)
      +- options (reused)
      +- WriteFile freetype (reused)
      +- compile lib freetype debug native (reused)
      +- WriteFile . (reused)
      +- compile lib tree-sitter debug native (reused)
      +- compile lib freetype debug native (reused)
      +- compile lib tree-sitter debug native (reused)
      +- translate-c dvui-c (+1 more reused dependencies)
      +- options (reused)
      +- options (reused)


scripts/zb build check-web --summary all (exit 0)

... (earlier output omitted)
|  |     +- run exe generate-def (amdgcn.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (arm.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (bpf.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (common.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (hexagon.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (loongarch.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (mips.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (neon.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (nvptx.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (powerpc.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (riscv.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (s390x.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (ve.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (wasm.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (x86_64.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (x86.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (xcore.zig) cached
|  |        +- compile exe generate-def debug native (reused)
|  +- options cached
|  +- options cached
|  +- options cached
|  +- options cached
|  +- options cached
|  +- options cached
|  +- options cached
|  +- options cached
|  +- options cached
|  +- options cached
|  +- translate-c cached 3ms MaxRSS:38M
+- compile obj rehome-fixture-web debug wasm32-freestanding cached 7ms MaxRSS:39M
   +- translate-c dvui-c (+1 more reused dependencies)
   +- options (reused)
   +- options (reused)


scripts/zb build test-sdk-version --summary all (exit 0)

... (earlier output omitted)
   +- WriteFile . cached
   +- compile lib tree-sitter debug native cached 9ms MaxRSS:35M
   +- compile lib freetype debug native (reused)
   +- compile lib tree-sitter debug native (reused)
   +- options cached
   +- options cached
   +- translate-c dvui-c cached
   |  +- compile exe translate-c debug native cached 6ms MaxRSS:39M
   |     +- options cached
   |     +- options cached
   |     +- options cached
   |     +- run exe generate-def (aarch64.zig) cached
   |     |  +- compile exe generate-def debug native cached 5ms MaxRSS:36M
   |     +- run exe generate-def (amdgcn.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (arm.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (bpf.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (common.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (hexagon.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (loongarch.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (mips.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (neon.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (nvptx.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (powerpc.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (riscv.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (s390x.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (ve.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (wasm.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (x86_64.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (x86.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (xcore.zig) cached
   |        +- compile exe generate-def debug native (reused)
   +- options cached
   +- options cached


fizzy-linux Bot and others added 3 commits October 25, 2026 04:20
Poll for the second build's waiting line and the load line with a 20s limit
that fails showing the output, so a slow CI runner cannot fail the test.

Agent-Team: linux
Worker: claude

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… on failure

Agent-Team: linux
Worker: claude

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
zb took a slot with mkdir and wrote the pid afterwards, leaving a pid-less
window in which another zb could judge the slot reclaimable. The merge queue
(run 40194938550) showed the result: two builds ran, one slot held a pid.
A slot is now built privately with its pid inside and renamed into place,
and the taker runs zig only if the slot's pid is its own.

Agent-Team: linux
Worker: claude

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@fizzy-pm

fizzy-pm Bot commented Oct 25, 2026

Copy link
Copy Markdown

PM note: how this PR will be handled

What it is for: scripts: test-zb-wait
Issue #287: scripts: test-zb.sh 'no waiting line' flakes in CI Format (blocks merges)
Done when (from the issue): draft PR; body starts Made by: <kind> then Part of fizzyedit/work#<this>; shows the 30-run loop result and the bite; then stop (no ready, no merge).

Rules that apply: none special.
Reviews needed: 1, from any other team or kind.
Needs the maintainer's explicit yes before merge: no

Things to watch (checked by rule):

  • the body names its work issue (Part of fizzyedit/work#N)
  • size within 800 lines outside tests and docs (47)
  • a gates section with what was run

What happens next:

  1. Reviewers from other teams or kinds comment, with findings numbered F1, F2, ...
  2. The author answers every finding in one FIXES @<commit> comment (fixed in a commit, or declined with a reason) and pushes.
  3. Reviewers re-review the new commit on their own.
  4. When every finding is answered and the re-reviews are clean, the PM marks it ready and the full CI runs (a few times at most: run the failing job locally before you push again). Only when CI passes does the PM look, and the PM gives the final okay.

A living status comment below is kept current. Nothing here is a merge decision.

@fizzy-pm

fizzy-pm Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Where this PR stands

Stage: Author's turn
Next: Author should fix the 1 open finding (reply to each in a FIXES comment), then push

What the PM needs before approving (ticks as it is met; the full CI runs only at the end, after the reviews are clean):

  • The body names its basis (Part of fizzyedit/work#N or a plan step)
  • Within the size limit: 68 of 800 lines outside tests and docs
  • The body shows which gates the author ran
  • No open findings at this commit (1 open)
  • Every earlier finding was answered in a FIXES comment (1 answered)
  • Clean reviews at this commit from 1 kind: linux/agy (has 1)
  • Marked ready, which starts the full CI (the PM does this the moment the items above are met)
  • The full CI passes at this commit (CI is green)
  • The PM's final okay (pm-approval)

Reviews at the current commit (3771ce5):

Reviewer Verdict Findings
linux/agy clean none
windows/codex changes 1

2 earlier reviews are for older commits and will be redone.

Latest fixes comment: https://github.com/fizzyedit/work/issues/329#issuecomment-6399703786 (1 finding answered)

Updated 2026-10-25 16:29 UTC by the PM. This comment is edited in place.

@fizzy-pm fizzy-pm Bot added pm:review one assigned reviewer reviews reviewer:linux-agy the PM assigned linux/agy to review this PR labels Oct 25, 2026
@fizzy-linux fizzy-linux Bot added reviewing:linux-codex a linux/codex review is running reviewing:linux-agy a linux/agy review is running and removed reviewing:linux-codex a linux/codex review is running reviewing:linux-agy a linux/agy review is running labels Oct 25, 2026
@fizzy-pm fizzy-pm Bot added pm:fixes author fixes the must-fix items and removed pm:review one assigned reviewer reviews labels Oct 25, 2026
Agent-Team: linux
Worker: claude

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@fizzy-windows fizzy-windows Bot added reviewing:windows-codex a windows/codex review is running reviewing:windows-agy a windows/agy review is running and removed reviewing:windows-agy a windows/agy review is running labels Oct 25, 2026
@fizzy-linux fizzy-linux Bot added reviewing:linux-agy a linux/agy review is running and removed reviewing:linux-agy a linux/agy review is running labels Oct 25, 2026
@fizzy-pm
fizzy-pm Bot marked this pull request as ready for review October 25, 2026 16:20
@fizzy-windows fizzy-windows Bot removed the reviewing:windows-codex a windows/codex review is running label Oct 25, 2026
@fizzy-linux fizzy-linux Bot removed the reviewing:linux-agy a linux/agy review is running label Oct 25, 2026
@fizzy-pm fizzy-pm Bot removed pm:fixes author fixes the must-fix items reviewer:linux-agy the PM assigned linux/agy to review this PR labels Oct 25, 2026
@fizzy-pm
fizzy-pm Bot added this pull request to the merge queue Oct 25, 2026
Merged via the queue into main with commit b6f18ed Oct 25, 2026
20 checks passed
@fizzy-pm
fizzy-pm Bot deleted the scripts/test-zb-wait branch October 25, 2026 16:56
fizzy-linux Bot added a commit that referenced this pull request Oct 25, 2026
Picks up #841, the zb waiting-line flake fix.

Agent-Team: linux
Worker: claude
fizzy-linux Bot added a commit that referenced this pull request Oct 25, 2026
Agent-Team: linux
Worker: claude
fizzy-linux Bot pushed a commit that referenced this pull request Oct 25, 2026
Agent-Team: linux
Worker: claude
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants